<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\facade\Route;

/*设置路由容错miss*/
Route::miss('public/miss');

/* ====================================================用户路由 =================================================*/
/*首页访问路由*/
Route::get('/', 'index');
/*显示前台留言板*/
Route::get('/message', 'index/index/showMessage');
/*显示关于我们页面*/
Route::get('/aboutMe', 'index/index/showAboutMe');
/*显示新闻动态页面*/
Route::get('/news', 'index/index/showNews');
/*显示干货共享*/
Route::get('/cargo', 'index/index/showCargo');
/*显示树洞页面*/
Route::get('/treesHole', 'index/index/showTreesHole');
/*显示分类列表*/
Route::get('/list/:listId', 'index/index/showList');
/*显示详细文章*/
Route::get('/details/:articleId', 'index/index/showDetails');


/*访问人数 测试接口*/
Route::get('/visitor', 'index/index/visitorControl');

/*-------------------------AJAX 异步请求---------------------------*/
Route::post('/getDetails/:articleId', "index/MyRequest/getDetails");
Route::post('/pushMessage', "index/MyRequest/pushMessage");


/* ==================================================== 管理员路由分组 =================================================*/
Route::group('admin',function (){
    /*后台首页*/
    Route::get('/', 'admin/index/index');
    /*后台登录*/
    Route::get('login', 'admin/login/showLogin');
    /*留言板管理*/
    Route::get('msg', 'admin/index/showMsgAdmin');
    /*类别管理*/
    Route::get('list', 'admin/index/showListAdmin');
    /*新增文章*/
    Route::get('add', 'admin/index/showAddAdmin');
    /*退出登录*/
    Route::get('logout','admin/index/exitLogin');
    /*显示修改文章页面*/
    Route::get("changeArticle/:articleId", 'admin/index/changeArticle');
    /*更改密码*/
    Route::get('showChangePass', 'admin/index/showChangePass');
    /*访客记录*/
    Route::get('visitor', 'admin/index/showVisitor');

    /*访客记录信息 经过处理*/
    Route::get('getVisitor', 'admin/Visitor/selectData');
    /*====================POST接口==============================*/
    // 验证密码
    Route::post("checkLogin","admin/CheckPass/checkLogin");
    /* 发布文章接口*/
    Route::post("pushArticle","admin/AdminRequest/pushArticle");
    /*删除文章接口*/
    Route::post("delArticle/:articleId", "admin/AdminRequest/delArticle");
    /* 更新文章接口*/
    Route::post("changeArticle/:articleId", 'admin/AdminRequest/changeArticle');
    /*审核通过留言板*/
    Route::post("passMsg/:msgId", 'admin/AdminRequest/passMsg');
    /*删除Msg*/
    Route::post("delMsg/:msgId", 'admin/AdminRequest/delMsg');
    /*修改密码*/
    Route::post("changePass", "admin/AdminRequest/updatePass");

});


return [

];
